<?php
class Macys_Api_Data_Storage {

	private $data = array();

	public function __construct($setUp = array()) {
		if(count($setUp) > 0) {
			foreach ($setUp as $key => $value) {
				if(is_array($value)) {
					$this->$key = new Macys_Api_Data_Storage($value);
				}
				else {
					$this->$key = $value;
				}
			}
		}
	}

	public function __set($k, $v) {
		$this->data[$k] = $v;
		return $this;
	}

	public function __get($k) {
		return $this->data[$k];
	}

	public function dump() {
		$this->arrayDumper($this->data);
	}

	private function arrayDumper($in=array()) {
		if(count($in) > 0) {
			foreach ($in as $key => $value) {
				if(is_array($value)) {
					$this->log->crit('MultiLevel Storage Found Error');
					$this->arrayDumper($value);
				}
				else {
					$this->log->debug('Storage Data Dump : ' . $key . ' = ' . $value);
				}
			}
		}
	}

}